bgo419737 - Don't clear filename entry in SAVE/CREATE_FOLDER modes
authorOlle Bergkvist <olle.bergkvist@yahoo.se>
Wed, 18 Jun 2008 22:23:39 +0000 (22:23 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Wed, 18 Jun 2008 22:23:39 +0000 (22:23 +0000)
2008-06-18  Olle Bergkvist <olle.bergkvist@yahoo.se>

http://bugzilla.gnome.org/show_bug.cgi?id=419737#c59 - The file
chooser clears the filename entry in SAVE/CREATE_FOLDER modes when
it shouldn't.

* gtk/gtkfilechooserdefault.c (shortcuts_activate_iter): Don't
clear the entry for CREATE_FOLDER either; this needs the same
behavior as SAVE mode.
(update_chooser_entry): Only clear the entry in OPEN/SELECT_FOLDER
modes.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=20455

ChangeLog
gtk/gtkfilechooserdefault.c

index 8c24234214bdea56fc81d7c140b9f6fcb81c6d6a..849a4e7d531d330f1f97c556a721714f6594fa9e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-06-18  Olle Bergkvist <olle.bergkvist@yahoo.se>
+
+       http://bugzilla.gnome.org/show_bug.cgi?id=419737#c59 - The file
+       chooser clears the filename entry in SAVE/CREATE_FOLDER modes when
+       it shouldn't.
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_activate_iter): Don't
+       clear the entry for CREATE_FOLDER either; this needs the same
+       behavior as SAVE mode.
+       (update_chooser_entry): Only clear the entry in OPEN/SELECT_FOLDER
+       modes.
+
 2008-06-18  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkfilesystem.c (_gtk_file_system_volume_render_icon):
index a911c95086da90d652d22cf18f1fd7e2261f6b9e..b120a1ac7e9f83b221ff196f5279680e7382d2e9 100644 (file)
@@ -6749,7 +6749,8 @@ update_chooser_entry (GtkFileChooserDefault *impl)
 
  maybe_clear_entry:
 
-  if (impl->browse_files_last_selected_name)
+  if ((impl->action == GTK_FILE_CHOOSER_ACTION_OPEN || impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
+      && impl->browse_files_last_selected_name)
     {
       const char *entry_text;
       int len;
@@ -10224,7 +10225,9 @@ shortcuts_activate_iter (GtkFileChooserDefault *impl,
   gpointer col_data;
   ShortcutType shortcut_type;
 
-  if (impl->location_mode == LOCATION_MODE_FILENAME_ENTRY && impl->action != GTK_FILE_CHOOSER_ACTION_SAVE)
+  if (impl->location_mode == LOCATION_MODE_FILENAME_ENTRY
+      && !(impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
+          || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER))
     _gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), "");
 
   gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), iter,